﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" EnableViewState="true"
    EnableSessionState="True" EnableEventValidation="false" CodeBehind="ContractSalesPerson.aspx.cs"
    Inherits="Client_Revenue.ContractSalesPerson" %>

<%@ Register Assembly="CustomValidator" Namespace="Client_Revenue.CustomValidators"
    TagPrefix="cc2" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="CheckBoxListExtender" Namespace="Client_Revenue.CheckBoxListExtender"
    TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <link href="Styles/datagrid.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .popupControl
        {
            background-color: #EBEBEB;
            border-width: 3px;
            border-style: solid;
            border-color: Gray;
            padding: 3px;
            width: 300px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        Contract sales team
    </h2>
    <%--<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>--%>
    <table style="text-align: justify; vertical-align: text-top; padding: 0px; margin: 20px 20px 20px 0px;">
        <tr>
            <td>
                <table style="text-align: justify; vertical-align: text-top; padding: 0px; vertical-align: text-top;">
                    <tr>
                        <td>
                            Client Name&nbsp;&nbsp;
                            <asp:DropDownList ID="ddClient" runat="server" AppendDataBoundItems="true"
                                OnSelectedIndexChanged="ddClient_SelectedIndexChanged" 
                                CausesValidation="True" >
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                ControlToValidate="ddClient" Display="Dynamic" InitialValue="0" EnableClientScript="True" 
                                ErrorMessage="Please select Client!" ForeColor="Red" 
                                SetFocusOnError="True"/>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="text-align: justify; vertical-align: text-top;">
                <h4 style="text-decoration: underline; font-weight: bold">
                    Producers
                </h4>
                <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Always">
                    <ContentTemplate>
                        <%--<asp:CheckBoxList ID="chlProducers" runat="server"  />--%>
                        <cc1:CheckBoxListExtender ID="chlProducers" runat="server" RepeatColumns="5" RepeatDirection="Vertical" />
                        <cc2:RequiredFieldValidatorForCheckBoxLists ID="RequiredFieldValidatorForCheckBoxLists1"
                            runat="server" ControlToValidate="chlProducers" Display="Dynamic" 
                            ErrorMessage="At least one Producer must be selected!" ForeColor="Red" 
                            SetFocusOnError="True"/>
                        <asp:HiddenField ID="hfProducerID" runat="server" />
                        <asp:HiddenField ID="hfCheckedItemIndex" runat="server" />
                        <%--Popup Control--%>
                        <asp:PopupControlExtender ID="PopupControlExtender1" runat="server" TargetControlID="chlProducers"
                            PopupControlID="pnlPopup" Position="Right" ViewStateMode="Enabled">
                        </asp:PopupControlExtender>
                        <asp:Panel ID="pnlPopup" runat="server" CssClass="popupControl">
                            <div>
                                <div>
                                    Sales Role
                                    <asp:DropDownList ID="ddProducerRole" runat="server" />
                                </div>
                                <div>
                                    Commission
                                    <asp:TextBox ID="txtProdComm" runat="server" Text="0.00" />
                                </div>
                                <div>
                                    Fee (if any)
                                    <asp:TextBox ID="txtProdFee" runat="server" Text="0.00" />
                                </div>
                                <div class="footer">
                                    <asp:LinkButton ID="bnProdCommSubmit" runat="server" OnClick="bnProdCommSubmit_Click"
                                        Text="Submit" CausesValidation="False" />
                                </div>
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                   <%-- <Triggers>
                        <asp:AsyncPostBackTrigger EventName="Click" ControlID = "bnProdCommSubmit" />
                    </Triggers>--%>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td>
                <table cellspacing="10" style="text-align: justify; vertical-align: text-top; padding: 0px;
                    vertical-align: text-top; width: 100%">
                    <tr>
                        <td align="center">
                            <asp:Button ID="btnSave" runat="server" OnClick="btnSave_Click" Text="Save" />
                        </td>
                    </tr>
                     <tr>
                        <td align="center">
                            <asp:Label ID="lblMessages" runat="server" ForeColor="Red"></asp:Label>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <%--</ContentTemplate>
    </asp:UpdatePanel>--%>
</asp:Content>
